//
//  AXFBrowserViewController.m
//  AXFEightGroup
//
//  Created by ooops on 12/24/16.
//  Copyright © 2016 ya. All rights reserved.
//

#import "AXFBrowserViewController.h"

@interface AXFBrowserViewController () <UIWebViewDelegate>

@property (nonatomic, strong) UIWebView *webView;       /** 浏览视图 */

@end

@implementation AXFBrowserViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //self.navigationController.navigationBar.hidden = YES;
    self.view = self.webView;
}

- (UIWebView *)webView {
    if(_webView == nil) {
        _webView= [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        _webView.delegate = self;
    }
    return _webView;
}


- (void)loadPageWithURL:(NSURL *)url {
    NSURLRequest *requst = [NSURLRequest requestWithURL:url];
    [self.webView loadRequest:requst];
}


- (void)setJumpURL:(NSURL *)jumpURL {
    _jumpURL = jumpURL;
    if(_jumpURL) {
        [self loadPageWithURL:jumpURL];
        [self.webView reload];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
